'use strict';

//引入模块
let Koa = require('koa');
let temp = require('./templating');

//实例化server服务器
let server = new Koa();

//注册使用中间件
server.use(temp);

server.use(async (ctx,next)=>{
    ctx.render('index.html',{name:'曾婷'});
})

//监听端口
let port = 3000;
server.listen(port,()=>{
    console.log(`http://localhost:${port}`);
})